<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript"></script>
</head>

<body>
<header th:replace="common/top"></header>
<div id="Content">
<div id="BackLink">
    <a th:href="@{/category/ViewCategory?categoryId=}+${product.categoryId}" th:text="'Return to '+${product.categoryId}">返回上一层</a>
</div>

<!--    <h2 th:text="${product.name}">${sessionScope.product.name}商品名字</h2>-->

<!--    <table>-->
<!--        <tr>-->
<!--            <th>Item ID</th>-->
<!--            <th>Product ID</th>-->
<!--            <th>Description</th>-->
<!--            <th>List Price</th>-->
<!--            <th>&nbsp;</th>-->
<!--        </tr>-->
<!--&lt;!&ndash;        <c:forEach var="item" items="${sessionScope.itemList}">&ndash;&gt;-->
<!--            <tr th:each="item:${itemList}">-->
<!--                <td>-->
<!--                    <a th:href="@{viewItem?itemId=}+${item.itemId}" th:text="${item.itemId}">${item.itemId}</a>-->
<!--                </td>-->

<!--                <td th:text="${item.product.productId}">${item.product.productId}</td>-->
<!--                <td th:text="${item.attribute1} + ${item.attribute2} + ${item.attribute3}-->
<!--                    ${item.attribute4} + ${item.attribute5} + ${product.name}">-->

<!--                    ${item.attribute1} ${item.attribute2} ${item.attribute3}-->
<!--                    ${item.attribute4} ${item.attribute5} ${sessionScope.product.name}-->
<!--                </td>-->
<!--                <td th:text="'$'+${item.listPrice}">-->
<!--&lt;!&ndash;                    <fmt:formatNumber value="${item.listPrice}" pattern="$#,##0.00" />&ndash;&gt;-->
<!--                </td>-->
<!--                <td>-->
<!--                    <a class="Button" href="addItemToCart?workingItemId=${item.itemId}">Add to Cart</a>-->
<!--                </td>-->
<!--            </tr>-->
<!--&lt;!&ndash;        </c:forEach>&ndash;&gt;-->
<!--        <tr>-->
<!--            <td>-->
<!--            </td>-->
<!--        </tr>-->
<!--    </table>-->
    <div id="Catalog">

        <h2 th:text="${product.name}">Product Name</h2>

        <table>
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th>&nbsp;</th>
            </tr>

            <tr th:each="item:${itemList}">
                <td><a th:href="'/category/viewItem?itemId='+${item.itemId}" th:text="${item.itemId}" >Item ID</a></td>
                <td th:text="${item.product.productId}">Product ID</td>
                <td th:text="${item.attribute1}">
                    Item Attributes
                </td>
                <!--                    <td th:text="${item.listPrice}">Item List Price</td>-->
                <td th:text="'$'+${#numbers.formatDecimal(item.listPrice,1,2)}">Item List Price</td>
                <td th:if="${item.quantity > 0}"><a th:href="'/cart/addItemToCart?workingItemId='+${item.itemId}">Add to Cart</a></td>
                <td th:if="${item.quantity <= 0}" style="text-align: center"><font color="#808080">缺货中</font></td>
            </tr>
        </table>
    </div>

</div>
</div>
<footer th:replace="common/bottom"></footer>
</body>
</html>